<?php
/**
 * 产品详情页面
 * thankwsx
 */
?>
<style>
#product_detail  div {
	margin:10px 0;
}
</style>
<script>
function selthisclass(obj) {
	$("#selclass").val($(obj).text());
}
function addnewclass(obj) {
	$("#newclass").remove();
	$(obj).after("<div id='newclass' ></div>");
	$("#newclass").html("<input type='text' name='class_name' id='class_name' value='' /><input type='button' value='添加' onclick='addclass();' />");
}
function addclass() {
	$.post("?controller=productclasses&action=addclass",{"class_name":$("#class_name").val(),"pcid":$("#classid").val(),"time":Math.random()},function(htmlcode){
		if(htmlcode==true) {
			$('#subclass').append("<span onclick='selthisclass(this);'>"+$("#class_name").val()+"</span>");
			$("#selclass").val($("#class_name").val());
			$("#newclass").remove();
		} else {
			alert(htmlcode);
		}
	});
}

</script>
	<div id="product_detail" style='text-align:left;'>
	<div><label>目前所处分类：</label><span onclick='selthisclass(this);'><?php echo $class['class_name'];?></span></div>
	<div>
		<label>产品名称</label>
		<?php echo $product["product_name"]; ?>
	</div>
	<div>
		<label>产品描述</label>
		<?php echo $product["product_desc"]; ?>
	</div>
	<div>
		<label>Tags</label><?php echo $product["tags"]; ?>
	</div>
	</div>
	<div>
<?php
	foreach($product_words as $word):
	echo "<div class='word'>";
	echo "<div class='word_body'>";
	echo "<p><span class='word_name'>".$word["word_name"]."</span><span class='user_name'>".$word['user']['user_name']."</span></p>";
	echo "<p><span class='fulltime'>".$word['created']."</span></p>";
	echo "<p class='tag_clound'>".$word["tags"][0]["tag_name"]."</p>";
	echo "<p class='word_desc'>".$word["word_desc"]."<br />回复：".count($word['reply'])."人</p>";
	echo "</div>";
	echo "</div>";
	endforeach;
?>
<input type="button" value="我来评论这个产品" id="act_add_word "/>
	</div>
<iframe name='ifmAction' height='0' width='0' />